import { getProducts,getScore,createOrder,getOrderList,cancelOrder,getVisibleCredit,getInsiderAvailableQuota } from 'api/order'
const order = {
	state:{

	},
	getters:{

	},
	actions:{
		// getData:function({commit},option){
		// 	return new Promise((resolve,reject) => {
		//         getData(option).then(response => {
		//           resolve(response);
		//         }).catch(error => {
		//           reject(error)
		//         })
		//     })
		// },
		GetProducts:function({commit},option){
			return new Promise((resolve,reject) => {
		        getProducts(option).then(response => {
		          resolve(response);
		        }).catch(error => {
		          reject(error)
		        })
		    })
		},
		GetScore:function({commit},option){
			return new Promise((resolve,reject) => {
		        getScore().then(response => {
		          resolve(response);
		        }).catch(error => {
		          reject(error)
		        })
		    })
		},
		GetVisibleCredit:function({commit},option){
			return new Promise((resolve,reject) => {
		        getVisibleCredit().then(response => {
		          resolve(response);
		        }).catch(error => {
		          reject(error)
		        })
		    })
		},
		CreateOrder:function({commit},option){
			return new Promise((resolve,reject) => {
		        createOrder(option).then(response => {
		          resolve(response);
		        }).catch(error => {
		          reject(error)
		        })
		    })
		},
		CancelOrder:function({commit},option){
			return new Promise((resolve,reject) => {
		        cancelOrder(option).then(response => {
		          resolve(response);
		        }).catch(error => {
		          reject(error)
		        })
		    })
		},
		GetOrderList:function({commit},option){
			return new Promise((resolve,reject) => {
		        getOrderList(option).then(response => {
		          resolve(response);
		        }).catch(error => {
		          reject(error)
		        })
		    })
		},
		GetInsiderAvailableQuota:function({commit},option){
			return new Promise((resolve,reject) => {
		        getInsiderAvailableQuota().then(response => {
		          resolve(response);
		        }).catch(error => {
		          reject(error)
		        })
		    })
		},
	},
	mutations:{

	}
}
export default order
